package com.f5.management.service.impl;

import com.f5.management.dao.PermissionDAO;
import com.f5.management.entity.Permission;
import com.f5.management.entity.dto.AdminUserAndRoleAndPermissionDto;
import com.f5.management.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PermissionServiceImpl
 * @Description TODO
 * @Author director吴
 * @Date 2021/4/8 16:43
 * @Version 1.0
 **/
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    PermissionDAO permissionDAO;


    //返回查询到的权限集合
    @Override
    public List<Permission> getPermissionList() {
        return permissionDAO.getPermissionList();
    }


    //返回用户角色的权限
    @Override
    public List<Permission> getPermissionsByAccount(String account) {

        return permissionDAO.getPermissionsByAccount(account);
    }

    //返回一个封装的权限，用户，信息
    @Override
    public List<AdminUserAndRoleAndPermissionDto> getAdminUserAndRoleAndPermissionDto() {
        return permissionDAO.geUserAndRoleAndPermissionDto();
    }
}
